package org.kalm;

import org.metaworks.annotation.Face;
import org.metaworks.annotation.Hidden;
import org.uengine.codi.mw3.admin.ClassDefinition;
import org.uengine.codi.mw3.model.JavaDesigner;
import java.io.Serializable;
import org.uengine.codi.ITool;
import org.springframework.beans.factory.annotation.Autowired;
import org.uengine.codi.mw3.alm.QualityOption;
import org.uengine.codi.mw3.alm.PMDRuleOption;
import org.uengine.codi.platform.SMS;

//@Face(ejsPath="genericfaces/Tab.ejs")
public class ClassDevelopmentTool implements Serializable, ITool{

    ClassDefinition classDefinition;
        public ClassDefinition getClassDefinition(){
            return this.classDefinition;
        }
        public void setClassDefinition(ClassDefinition classDefinition){
            this.classDefinition = classDefinition;
        }
        
    
        
    public ClassDevelopmentTool(){
        setClassDefinition(new ClassDefinition());
  //      setPMDRuleOption(new PMDRuleOption());
    }
    
    @Override
	public void beforeComplete() {
	}
    
    @Override
    public void onLoad() {
		
		if(org.uengine.util.UEngineUtil.isNotEmpty(getResourceName())){

			try {
                
                designer = new JavaDesigner();
                System.out.println(designer);
                designer.setAlias(getResourceName());
				designer.load();

                classDefinition = designer.getClassDefinition();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	
		}
	}
    
    @Autowired
    public JavaDesigner designer;
 
 
    public void afterComplete(){}

	java.lang.String resourceName;
    @Hidden
		public java.lang.String getResourceName(){ return resourceName; }
		public void setResourceName(java.lang.String resourceName){ this.resourceName = resourceName; }


}